<template>
    <div class="homeworkDetail">
        <div class="title">
            作业详情
        </div>
        <div class="topBox">
            <!-- <div class="topBox_left">
                <div class="topBox_left_item" :class="{ 'topBox_left_itemed': typecurrIndex == 0 }"
                    @click="handleTypecurrIndex(0)">
                    <div>
                        语音题
                    </div>
                    <span v-if="typecurrIndex == 0" class="heng"></span>
                </div>
                <div class="topBox_left_item" :class="{ 'topBox_left_itemed': typecurrIndex == 1 }"
                    @click="handleTypecurrIndex(1)">
                    <div>
                        书写作业
                    </div>
                    <span v-if="typecurrIndex == 1" class="heng"></span>
                </div>
            </div> -->

            <div class="topBox_right">
                <div>
                    <img class="avatar" src="@/static/image/logo.png" alt="" srcset="">
                </div>
                <div class="mesasge">
                    <div>
                        Aimee
                    </div>
                    <div>
                        143***5678
                    </div>
                </div>
            </div>

            <div class="topBox_left">
                <div class="btn">
                    打回
                </div>
                <div class="btn btns">
                    完成批改
                </div>
            </div>
        </div>

        <div class="workContent">
            <div class="workTitle_content">
                <div class="titlecontent">
                    一，作业题目作业题目作业题目
                </div>
                <div class="questiontext">
                    1.作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容
                    2.作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容作业内容
                </div>
            </div>


            <div class="tip_content">
                <div class="tip_left">
                    学生提交
                </div>
                <div class="">
                    提交时间：2024/12/12
                </div>
            </div>

            <div class="workList">
                <div class="workItem" v-for="(item, index) in workList" :key="index">
                    <div>{{ index + 1 }}.</div>
                    <div v-if="item.type == 1" class="voicecontnet">
                        <img class="yyimage" src="@/static/image/yy.png" alt="" srcset="">
                    </div>
                    <div v-if="item.type == 1">
                        1.0x
                    </div>
                    <div v-if="item.type == 2 || item.type == 3" class="mpcontent">
                        <img v-if="item.type == 2" class="yyimage" src="@/static/image/MP3.png" alt="" srcset="">
                        <img v-if="item.type == 3" class="yyimage" src="@/static/image/MP4.png" alt="" srcset="">
                        <div class="contnetRight">
                            <div>f...sg.mp3</div>
                            <div class="contnetkb">300.3KB</div>
                        </div>
                    </div>

                    <div v-if="item.type == 4" class="imgContent">
                        <img class="workimg" :src="imgitem" v-for="(imgitem, imgindex) in item.images" :key="imgindex">
                    </div>
                </div>
            </div>


            <div class="teacherContent">
                <div class="tip">
                    教师批改：
                </div>
                <div class="comment">
                    <el-input type="textarea" :rows="3" placeholder="请输入评语" v-model="textarea">
                    </el-input>
                </div>
                <div class="tip">
                    奖励星星：
                </div>

                <div class="start_content">
                    <div class="startitem" v-for="(item, index) in 10" :key="index"
                        @click="handleStartstartCurrindex(index)">
                        <!-- startCurrindex -->
                        <img v-if="index <= startCurrindex" class="startimg" src="../../static/image/started.png">
                        <img v-else class="startimg" src="../../static/image/start.png">
                    </div>
                    <div v-if="startCurrindex > 0" class="startNum">
                        {{ startCurrindex + 1 }} 颗
                    </div>

                    <div v-if="startCurrindex > 0" class="startNum" @click="handleStartstartCurrindex(-1)">
                        清空
                    </div>
                </div>
            </div>

        </div>

    </div>
</template>

<script>
export default {
    data() {
        return {
            typecurrIndex: 0,
            workList: [
                { type: 1, time: '00:00' },
                { type: 2 },
                { type: 3 },
                {
                    type: 4,
                    images: ['https://img0.baidu.com/it/u=3428680834,3288239978&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=800']
                },
            ],
            startCurrindex: -1
        }
    },
    methods: {
        handleTypecurrIndex(index) {
            this.typecurrIndex = index
        },
        handleStartstartCurrindex(index) {
            this.startCurrindex = index
        },
    }
}
</script>
<style scoped lang="scss">
.homeworkDetail {
    padding: 20px;
    box-sizing: border-box;

    .title {
        font-family: Alibaba PuHuiTi, Alibaba PuHuiTi;
        font-weight: 500;
        font-size: 14px;
        color: #5C5C5C;
        line-height: 16px;
    }

    .topBox {
        width: 100%;
        height: 72px;
        background: #FFFFFF;
        border-radius: 4px 4px 4px 4px;
        margin-top: 16px;
        padding: 16px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .topBox_left {
            display: flex;

            .btn {
                width: 275px;
                height: 40px;
                border-radius: 4px 4px 4px 4px;
                border: 1px solid #4BA840;
                font-family: PingFang SC, PingFang SC;
                font-weight: 500;
                font-size: 14px;
                color: #4BA840;
                line-height: 40px;
                text-align: center;
                margin-right: 30px;
                cursor: pointer;
            }

            .btns {
                background: #4BA840;
                color: #ffffff;
            }

            .topBox_left_item {
                font-family: PingFang SC, PingFang SC;
                font-weight: 500;
                font-size: 15px;
                line-height: 19px;
                margin-right: 30px;
                cursor: pointer;
                display: flex;
                flex-direction: column;
                align-items: center;

                .heng {
                    display: inline-block;
                    width: 24px;
                    height: 2px;
                    background: #4BA840;
                    border-radius: 8px 8px 8px 8px;
                    margin-top: 10px;
                }
            }

            .topBox_left_itemed {
                color: #4BA840;
            }
        }

        .topBox_right {
            display: flex;
            align-items: center;

            .avatar {
                width: 40px;
                height: 40px;
                border-radius: 20px;
            }

            .mesasge {
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 12px;
                color: #333333;
                line-height: 20px;
            }
        }
    }


    .workContent {
        width: 100%;
        height: 675px;
        background: #FFFFFF;
        border-radius: 4px 4px 4px 4px;
        margin-top: 16px;
        padding: 16px;
        box-sizing: border-box;
        overflow: auto;

        .workTitle_content {
            width: 100%;

            .titlecontent {
                font-family: PingFang SC, PingFang SC;
                font-weight: 500;
                font-size: 14px;
                color: #777777;
                line-height: 20px;
            }

            .questiontext {
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 12px;
                color: #333333;
                line-height: 20px;
                margin-top: 8px;
            }

        }
    }

    .tip_content {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-family: PingFang SC, PingFang SC;
        font-weight: 400;
        font-size: 14px;
        color: #333333;
        line-height: 20px;
        margin-top: 10px;
        font-weight: bold;
    }

    .workList {
        margin-top: 26px;

        .workItem {
            display: flex;
            align-items: center;
            margin-bottom: 30px;

            .voicecontnet {
                width: 223px;
                height: 34px;
                background: #EAF9E8;
                border-radius: 6px 6px 6px 6px;
                padding: 5px 8px;
                box-sizing: border-box;
                margin: 0 35px;
                display: flex;
                align-items: center;

                .yyimage {
                    width: 23.19px;
                    height: 23.19px;
                    cursor: pointer;
                }
            }

            .mpcontent {
                width: 220px;
                height: 58px;
                background: #EAF9E8;
                border-radius: 8px 8px 8px 8px;
                padding: 5px 9px;
                box-sizing: border-box;
                display: flex;
                align-items: center;
                margin: 0 35px;

                .yyimage {
                    width: 40px;
                    height: 40px;
                    cursor: pointer;
                }

                .contnetRight {
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 500;
                    font-size: 15px;
                    color: #777777;
                    line-height: 17px;

                    .contnetkb {
                        font-family: PingFang SC, PingFang SC;
                        font-weight: 400;
                        font-size: 12px;
                        color: #AAAAAA;
                        line-height: 14px;
                        margin-top: 5px;
                    }
                }

            }

            .imgContent {
                display: flex;
                align-items: center;
                margin: 0 35px;

                .workimg {
                    width: 102px;
                    height: 136px;
                    border-radius: 4px 4px 4px 4px;
                    cursor: pointer;
                    margin-right: 12px;
                    object-fit: cover;
                }
            }
        }
    }



    .teacherContent {
        .tip {
            font-family: PingFang SC, PingFang SC;
            font-weight: 550;
            font-size: 14px;
            color: #333333;
            line-height: 20px;
            margin-top: 10px;
        }

        .comment {
            margin-top: 10px;
        }

        .start_content {
            display: flex;
            align-items: center;
            margin-top: 10px;

            .startitem {
                margin-right: 4px;
                cursor: pointer;

                .startimg {
                    width: 32px;
                    height: 32px;
                }
            }

            .startNum {
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 12px;
                color: #AAAAAA;
                line-height: 20px;
                text-align: left;
                margin-left: 30px;
                cursor: pointer;
            }
        }

    }
}
</style>